package tasknow.utils;

public class Constants {

	// @author A0096638M

	public enum COMMANDS {
		ADD, Q, CLEAR, NEW, DELETE, DEL, D, REMOVE, EXIT, QUIT, INVALID, SEARCH, FIND, SORT, UNDO, REDO, EDIT, MODIFY, MOD, CHANGE, MARK, DONE, ARCHIVE, ARCHIVED, SAVE, LOAD, FLOAT
	};

	public enum MODIFY_CHOICE {
		D, S, E, INVALID
	}

	public enum TASK_STATUS {
		COMPLETED, INCOMPLETE, OVERDUE
	}

	// Other Constants
	public static final String BLANK_SPACE = " ";
	public static final String EMPTY_STRING = "";
	public static final String NEW_LINE = "\n";

	public static final String CONCANTENATE_DATE_AND_TIME = "%1$s %2$s";
	public static final String DUMMY_STRING = "";
	public static final String STRING_ZERO = "0";

	public static final String STRING_TODAY = "today";
	public static final String STRING_TONIGHT = "tonight";
	public static final String STRING_TOMORROW = "tomorrow";
	public static final String STRING_DAY = "day";
	public static final String STRING_NEXT = "next";
	public static final String STRING_NIL_DATE = "-";
	public static final String STRING_ADD = "add";
	public static final String STRING_DELETE = "delete";

	// Shortcut Strings
	public static final String SHORTCUT_2DAY = "2day";
	public static final String SHORTCUT_2NIGHT = "2night";
	public static final String SHORTCUT_2NITE = "2nite";
	public static final String SHORTCUT_PLUS = "+";
	public static final String SHORTCUT_MINUS = "-";
	public static final String SHORTCUT_NXT = "nxt";
	public static final String SHORTCUT_TMR = "tmr";
	public static final String SHORTCUT_TDY = "tdy";
	public static final String SHORTCUT_TO9 = "to9";
	public static final String SHORTCUT_AT = "@"; 
	public static final String SHORTCUT_B4 = "b4";
	public static final String SHORTCUT_MON = "mon";
	public static final String SHORTCUT_TUE = "tue";
	public static final String SHORTCUT_TUES = "tues";
	public static final String SHORTCUT_WED = "wed";
	public static final String SHORTCUT_THU = "thu";
	public static final String SHORTCUT_THUR = "thur";
	public static final String SHORTCUT_THURS = "thurs";
	public static final String SHORTCUT_FRI = "fri";
	public static final String SHORTCUT_SAT = "sat";
	public static final String SHORTCUT_SUN = "sun";

	// Formatting for Strings
	public static final String FORMAT_INDEX = "%1$d.";

	public static final String PROMPT_NO_SEARCH_WORD_INPUT = "Please enter the word to search.";

	// Welcome Message
	public static final String MSG_WELCOME = "Welcome to TaskNow. Press F1 if you need help.";

	// Add
	public static final String MSG_ADD_LINE = "Task \"%1$s\" has been added";

	// Clear
	public static final String MSG_CLEAR_FILE = "All tasks has been cleared.";

	// Delete
	public static final String MSG_DELETE = "\"%1$s\" has been deleted.";

	// Sort
	public static final String MSG_SORT_EMPTY_FILE = "There is nothing to sort.";
	public static final String MSG_SORTED_ALPHABETICALLY = "Sorted alphabetically.";
	public static final String MSG_SORTED_BY_DEADLINE = "Sorted by deadline.";
	public static final String MSG_SORTED_BY_START_DATE = "Sorted by start date.";
	public static final String[] DEFAULT_SORT = {"sort", "e"};

	// Search
	public static final String MSG_NOTIFY_NO_TASK_FOUND = "There are no task found.";
	public static final String MSG_NOTIFY_ONE_TASK_FOUND = "There is 1 task found.";
	public static final String MSG_NOTIFY_MANY_TASK_FOUND = "There are %1$d tasks found.";
	public static final String COMMAND_SEARCH = "search";

	// Undo and Redo
	public static final String MSG_INVALID_UNDO = "Unable to undo anymore.";
	public static final String MSG_INVALID_REDO = "Unable to redo anymore.";
	public static final String MSG_UNDO_LAST_TASK = "Undid successfully.";
	public static final String MSG_REDO_LAST_TASK = "Redid successfully.";

	// Mark
	public static final String MSG_MARKED_AS_COMPLETE = "\"%1$s\" marked as complete.";
	public static final String MSG_MARKED_AS_INCOMPLETE = "\"%1$s\" marked as incomplete.";

	// Modify
	public static final String MSG_DESCRIPTION_CHANGED = "Task Description changed to \"%1$s\"";
	public static final String MSG_START_DATE_TIME_CHANGED = "Task \"%1$s\" start date changed to \"%2$s\" and start time changed to \"%3$s\"";
	public static final String MSG_START_DATE_CHANGED = "Task \"%1$s\" start date changed to \"%2$s\"";
	public static final String MSG_START_TIME_CHANGED = "Task \"%1$s\" start time changed to \"%2$s\"";
	public static final String MSG_END_DATE_TIME_CHANGED = "Task \"%1$s\" end date changed to \"%2$s\" and end time changed to \"%3$s\"";
	public static final String MSG_END_DATE_CHANGED = "Task \"%1$s\" end date changed to \"%2$s\"";
	public static final String MSG_END_TIME_CHANGED = "Task \"%1$s\" end time changed to \"%2$s\"";
	public static final String MSG_MODIFY_REMOVED_START_DATE = "Task \"%1$s\" start date and time has been removed.";
	public static final String MSG_MODIFY_REMOVED_END_DATE = "Task \"%1$s\" end date and time has been removed.";
	public static final String MODIFY_DESCRIPTION = "D";
	public static final String MODIFY_START_DATE = "S";
	public static final String MODIFY_END_DATE = "E";
	public static final int MODIFY_DATE_OR_TIME_ARGUMENTS = 3;
	public static final int MODIFY_DATE_AND_TIME_ARGUMENTS = 4;
	public static final int INDEX_MODIFY_TASK_NUMBER = 0;
	public static final int INDEX_MODIFY_ARGUMENT = 1;
	public static final int INDEX_MODIFY_TASK_INFORMATION_START = 2;

	// Display
	public static final String FORMAT_TASKS_DUE_TODAY_NONE = "You have no task due today.";
	public static final String FORMAT_TASKS_DUE_TODAY_ONE = "You have 1 task due today.";         //Change to MSG
	public static final String FORMAT_TASKS_DUE_TODAY_MULTIPLE = "You have %1$d tasks due today.";
	public static final String FORMAT_DATE_STRING = "%1$02d/%2$02d/%3$02d";
	public static final String FORMAT_DATE_COMPONENT = "%1$02d";
	public static final String FORMAT_DATE_STRING_NO_SLASH = "%1$02d%2$02d%3$02d";

	// Archive
	public static final String XML_EXTENSION = ".xml";
	public static final String PROMPT_FILE_INPUT = "Please enter a file name: ";
	public static final String FORMAT_ARCHIVE_FILES_NONE = "There are no tasks to archive.";
	public static final String FORMAT_ARCHIVE_FILES_ONE = "1 tasks has been archived.";
	public static final String FORMAT_ARCHIVE_FILES_MULTIPLE = "%1$d tasks have been archived.";
	public static final String MSG_EMPTY_ARCHIVE_VECTOR = "Archive is empty";
	public static final String MSG_FILE_DOES_NOT_EXIST = "\"%1$s\" does not exist";
	public static final String MSG_INVALID_FILE_NAME = "Invalid file name";
	public static final String MSG_LOADED_FROM_STORAGE = "\"%1$s\" loaded sucessfully";
	public static final String MSG_SAVED_TO_STORAGE = "\"%1$s\" saved sucessfully";
	public static final String MSG_ARCHIVE_DISPLAYED = "Archive displayed";

	// Error Messages
	public static final String ERROR_NULL_COMMAND_INPUT = "Please enter a command.";
	public static final String ERROR_INVALID_COMMAND = "Invalid command \"%1$s\" detected.";
	public static final String ERROR_INVALID_INPUT = "Invalid input \"%1$s\" detected.";
	public static final String ERROR_VECTOR_OUT_OF_BOUND = "Error: Vector out of bound.";
	public static final String ERROR_INVALID_NUMBER_ARGUMENT = "Invalid Argument(s). Please input an integer.";
	public static final String ERROR_INVALID_ARGUMENT_DETECTED = "Invalid Argument \"%1$s\" detected.";
	public static final String ERROR_ADD_ARGUMENT_TOO_LONG = "Please restrict your task description between 0 and 32 characters.";
	public static final String ERROR_ADD_TOO_MANY_TASKS = "You have too many tasks. Please finish up a few before adding more.";
	public static final String ERROR_ADD_ARGUMENT_MISSING = "Please enter a task description.";
	public static final String ERROR_ADD_TASK_DATE = "You cannot set the end before its start!";
	public static final String ERROR_MARK_INVALID_TASK = "There is no such task.";
	public static final String ERROR_MARK_INVALID_ARGUMENT_DETECTED = "Invalid mark argument: \"%1$s\"";
	public static final String ERROR_MODIFY_INVALID_TASK = "There is no such task.";
	public static final String ERROR_MODIFY_INVALID_ARGUMENT_DETECTED = "Invalid modify argument: \"%1$s\"";
	public static final String ERROR_INVALID_START_MODIFICATION = "You cannot set a start after its end !";
	public static final String ERROR_INVALID_START_TIME_MODIFICATION = "You must set a start date before modifying start time!";
	public static final String ERROR_INVALID_END_MODIFICATION = "You cannot set a end before its start !";
	public static final String ERROR_INVALID_END_TIME_MODIFICATION = "You must set a end date before modifying end time!";
	public static final String ERROR_MODIFY_TYPE_REQUEST = "Please enter modify in \"modify <task number> <d/s/e> <modification>\"";
	public static final String ERROR_DELETE_INVALID_TASK = "There is no such task.";
	public static final String ERROR_DELETE_INVALID_ARGUMENT = "Invalid delete argument: \"%1$s\"";
	public static final String ERROR_MARK_INVALID_INTEGER_INPUT = "Please enter a number to mark the task.";
	public static final String ERROR_MODIFY_INVALID_INTEGER_INPUT = "Please enter a number to modify the task.";
	public static final String ERROR_DELETE_INVALID_INTEGER_INPUT = "Please enter a number to delete the task.";

	// Default Filenames
	public static final String DEFAULT_FILE_NAME = "tasknow.xml";
	public static final String DEFAULT_ARCHIVE_FILE_NAME = "archive.xml";

	// Inputs
	public static final int LENGTH_COMMAND_AND_INPUT = 2;
	public static final int INDEX_COMMAND = 0;
	public static final int INDEX_INPUT = 1;

	// Vector Sizes
	public static final int SIZE_ONE_DATE_TIME = 2;
	public static final int SIZE_TWO_ARRAY = 2;
	public static final int SIZE_THREE_ARRAY = 3;

	// Adjustments
	public static final int ADJUST_INDEX_BY_1 = 1;
	public static final int ADJUST_INDEX_BY_2 = 2;
	public static final int ADJUST_MONTH_BY_ONE = 1;
	public static final int ADJUST_TWELVE_HOURS = 12;

	// Limits
	public static final int FORMAT_TASKS_LIMIT = 99;
	public static final int MAX_ALLOWED_TIME = 2400;
	public static final int MAX_NUMBER_OF_DAYS = 31;
	public static final int MIN_NUMBER_OF_DAYS = 01;
	public static final int MAX_NUMBER_OF_MONTHS = 12;
	public static final int MIN_NUMBER_OF_MONTHS = 00;
	public static final int MAX_NUMBER_OF_YEARS = 99;
	public static final int MAX_NUMBER_OF_HOURS = 24;
	public static final int MAX_NUMBER_OF_MINUTES = 59;
	public static final int MAX_NUMBER_OF_TWELVE_HOURS = 12;

	// Index
	public static final int INDEX_START_CALENDAR = 0;
	public static final int INDEX_END_CALENDAR = 1;	
	public static final int INDEX_ONE_DATE_ARRAY = 0;
	public static final int INDEX_SUBSTRING_FIRST = 0;
	public static final int INDEX_DATE_ARGS = 0;
	public static final int INDEX_TIME_ARGS = 1;

	//Date-Time Indexes
	public static final int INDEX_DAY_SUBSTRING_START = 0;
	public static final int INDEX_DAY_SUBSTRING_END = 2;
	public static final int INDEX_MONTH_SUBSTRING_START = 2;
	public static final int INDEX_MONTH_SUBSTRING_END = 4;
	public static final int INDEX_YEAR_SUBSTRING_START = 4;
	public static final int INDEX_YEAR_SUBSTRING_END = 6;
	public static final int INDEX_HOUR_SUBSTRING_START = 0;
	public static final int INDEX_HOUR_SUBSTRING_END = 2;
	public static final int INDEX_MINUTE_SUBSTRING_START = 2;
	public static final int INDEX_MINUTE_SUBSTRING_END = 4;

	// Integers
	public static final int ZERO_ARGUMENT = 0;
	public static final int ZEROTH = 0;
	public static final int FIRST = 1;
	public static final int SECOND = 2;
	public static final int THIRD = 3;
	public static final int TWENTY_FIRST_CENTURY = 2000;
	public static final int DAYS_IN_ONE_WEEK = 7;
	public static final int ONE_DAY = 1;
	public static final int DEFAULT_YEAR = 1970;
	public static final int DEFAULT_HOUR = 00;
	public static final int DEFAULT_MINUTE = 00;
	public static final int NO_SUCH_DAY = -1;

	// Characters
	public static final String CHARACTER_D = "d";
	public static final String CHARACTER_S = "s";
	public static final String CHARACTER_E = "e";

	// Time
	public static final String TIME_NOON_HOUR = "12";
	public static final String TIME_MIDNIGHT_HOUR_INPUT = "24";
	public static final String TIME_MIDNIGHT_HOUR_ACTUAL = "00";

	// Lengths
	public static final int LENGTH_DATE_TIME_FORMAT = 11;
	public static final int LENGTH_DATE_FORMAT = 6;
	public static final int LENGTH_TIME_FORMAT = 4;
	public static final int LENGTH_HOUR_ONLY = 2;
	public static final int LENGTH_ONE_HOUR_DIGIT_WITH_MINUTES = 3;
	public static final int LENGTH_ACCEPTABLE_TASK_DESCRIPTION = 32;
	public static final int MINIMUM_LENGTH_STRING_DAY = 5;
	public static final int LENGTH_NO_ARGUMENTS = 1;
	public static final int LENGTH_STRING_AM = 2;
	public static final int LENGTH_STRING_PM = 2;

	// Date-Time Related Indexes
	public static final int DATE = 0;
	public static final int TIME = 1;
	public static final int DAY = 0;
	public static final int MONTH = 1;
	public static final int YEAR = 2;
	public static final int HOUR = 0;
	public static final int MINUTE = 1;

	public static final int TOMORROW = 1;

	// Time-related String
	public static final String STRING_AM = "AM";
	public static final String STRING_PM = "PM";

	// Task-related String
	public static final String NO_START_DATE = "   --   ";
	public static final String NO_START_TIME = "  -- ";
	public static final String NO_END_DATE = "   --   ";
	public static final String NO_END_TIME = "  -- ";
	public static final String STRING_COMPLETED = "Completed ";
	public static final String STRING_INCOMPLETE = "Incomplete";
	public static final String STRING_OVERDUE = " Overdue  ";
	public static final String PREPOSITION_TO = "to";
	public static final String PREPOSITION_AT = "at";
	public static final String PREPOSITION_FROM = "from";
	public static final String PREPOSITION_BY = "by";
	public static final String PREPOSITION_ON = "on";
	public static final String PREPOSITION_BEFORE = "before";

	// Boolean
	public static final boolean COMPLETE = true;
	public static final boolean INCOMPLETE = false;

	// Comparators
	public static final int AFTER = 1;
	public static final int BEFORE = -1;
	public static final int SAME = 0;
	public static final String MSG_DAMAGED_XML_FILE = "Failed to read from \"%1$s\": XML-file is damaged";

}